<?php
namespace app\index\controller;

class Index extends BaseHome
{
    public function index()
    {
        //轮播
        $lbp=db("lb")->where("fid=1 and status=1")->order("sort asc")->select();
        $this->assign("lbp",$lbp);
        
        $lbm=db("lb")->where("fid=2 and status=1")->order("sort asc")->select();
        $this->assign("lbm",$lbm);
        
        //简介
        $reb=db("lb")->where("fid=4")->find();
        $this->assign("reb",$reb);
        
        $red=db("lb")->where("fid=5")->find();
        $this->assign("red",$red);
        
        $rett=db("lb")->where("fid=24")->find();
        $this->assign("rett",$rett);
        
        //新闻中心
        $res=db("news_type")->select();
        foreach ($res as $k => $v){
            $res[$k]['list']=db("news")->where("fid={$v['ty_id']} and status=1 and groom=1")->order(['sort'=>'asc','id'=>'desc'])->limit(5)->select();
        }
        $this->assign("res",$res);
        
       // 产品中心
        $cases=db("cases")->where("status=1 and groom=1")->order("sort asc")->paginate(5);
        $this->assign("cases",$cases);
        
        //旗下产业
        $req=db("lb")->where("fid=14 and status=1")->order("sort asc")->select();
        $this->assign("req",$req);
        
        //集团文化
        $rej=db("lb")->where("fid=15 and status=1")->order("sort asc")->select();
        $this->assign("rej",$rej);
        
        //团队风采
        $ret=db("team")->where("status=1")->order("sort asc")->select();
        $this->assign("ret",$ret);
        
        //在线招聘
        $rez=db("job")->where("status=1")->order("sort asc")->paginate(4);
        $this->assign("rez",$rez);
       
        
        return \view("index");
    }
}
